from toee import *
from utilities import *

def san_dialog( attachee, triggerer ):
	attachee.turn_towards(triggerer)
	if ( game.quests[99].state == qs_accepted and game.global_vars[698] != 6):
		triggerer.begin_dialog( attachee, 1 )
	else:
		triggerer.begin_dialog( attachee, 30 )
	return SKIP_DEFAULT

def san_dying( attachee, triggerer ):
	game.global_vars[698] = 3
	return RUN_DEFAULT

def san_enter_combat( attachee, triggerer ):
	if (triggerer.type == obj_t_pc ):
		goblin = find_npc_near( attachee, 14686)
		if (goblin != OBJ_HANDLE_NULL):
			goblin.attack(triggerer)
	if (triggerer.type == obj_t_pc ):
		goblin = find_npc_near( attachee, 14686)
		if (goblin != OBJ_HANDLE_NULL):
			goblin.attack(triggerer)
	if (triggerer.type == obj_t_pc ):
		goblin = find_npc_near( attachee, 14686)
		if (goblin != OBJ_HANDLE_NULL):
			goblin.attack(triggerer)
	return RUN_DEFAULT

def behave(attachee, triggerer):
	attachee.npc_flag_unset(ONF_WAYPOINTS_DAY)
	attachee.npc_flag_unset(ONF_WAYPOINTS_NIGHT)
	for obj in game.obj_list_vicinity(attachee.location,OLC_NPC):
		if obj.name == 14686:
			obj.npc_flag_unset(ONF_WAYPOINTS_DAY)
			obj.npc_flag_unset(ONF_WAYPOINTS_NIGHT)
	return